<template>
    <div>
      <!--店铺卡片:循环-->
      <restaurant-card v-for="restaurant in restaurantCollection" :key="restaurant.id" :restaurant="restaurant"></restaurant-card>
    </div>
</template>

<script>
  import RestaurantCard from '../../components/restaurant/RestaurantCard'
    export default {
        name: "Collection",
      components:{
          RestaurantCard,
      },
      data() {
          return{
            restaurantCollection: [
              {
                id: 2233,           //id
                shopId: 2233,       //店铺编号
                rName: '店名',      //店名
                location: '位置',   //位置
                image: '店铺图片',      //店铺图片
                rDescription: '描述', //描述
              },
              {
                id: 2234,           //id
                shopId: 2234,       //店铺编号
                rName: '店名2',      //店名
                location: '位置2',   //位置
                image: '店铺图片2',      //店铺图片
                rDescription: '描述2', //描述
              },
              {
                id: 2235,           //id
                shopId: 2235,       //店铺编号
                rName: '店名3',      //店名
                location: '位置3',   //位置
                image: '店铺图片3',      //店铺图片
                rDescription: '描述3', //描述
              },
              {
                id: 2236,           //id
                shopId: 2236,       //店铺编号
                rName: '店名',      //店名
                location: '位置',   //位置
                image: '店铺图片',      //店铺图片
                rDescription: '描述', //描述
              },
            ]
          }
      },
      created() {
          this.$axios.get("/user/mycollection", {params: {uid: this.$store.getters.uid}})
            .then(response => {
              if (response.data.success) {
                this.restaurantCollection=response.data.my_collection_list;
              }
              console.log(response.data.message);
            })
            .catch(error => console.log(error));
      },
      methods: {

      }
    }
</script>

<style scoped>

</style>
